#ifndef JKINDATA_H
#define JKINDATA_H

#include <QObject>
#include "QGLViewer/qglviewer.h"

class JKinData : public QObject
{
	Q_OBJECT

public:
	JKinData(const QString& filePath);
	~JKinData();

	int numKeyframes() { return nbKeyFrames; }
	GLdouble* glMatrix() { return kfi_.frame().matrix(); }
	GLdouble* glMatrix(int index) { return kfi_.keyFrame(index).matrix(); }

private:
	int readNumDataLines(const QString& filePath);
	bool loadJTSData(const QString& filePath);
	void toQuaternion312(double z_rot, double x_rot, double y_rot, double* rotation);

	qglviewer::ManipulatedFrame** keyFrame_;
	qglviewer::KeyFrameInterpolator kfi_;
	int nbKeyFrames;
	int currentKF_;
};

#endif // JKINDATA_H
